Skip to content

Conversation

@dmtrshat
Copy link
Member

  • Added rich, rustc-like diagnostics: render errors with file context + labeled span + optional help text.
  • Introduced a SourceFile container to carry path/name + full content so errors can always attach a readable source snippet.
  • Extended parsing to track spans (start, len) for each extracted class/spell token, and propagate that through spell generation:
    • Spans collected in parser_base.rs.
    • FS parser wraps errors with source content in parser_fs.rs.
    • Spans/source carried by Spell in spell.rs.
  • Upgraded the error model to support structured compile errors (message/label/help/span/source) instead of only plain strings:
  • Added a dedicated diagnostics adapter mapping GrimoireCssError -> miette::Diagnostic.
  • Improved common user mistake messaging (especially HTML space-splitting) and earlier validation:
    • Better errors for malformed function-like values / parentheses: spell_value_validator.
    • Color function argument validation now returns a proper error (instead of silently ignoring): color_functions.rs.
  • Added an error_scenarios sandbox with minimal repro HTML/config to quickly verify diagnostics quality.

closes #95

@dmtrshat dmtrshat self-assigned this Dec 26, 2025
@github-project-automation github-project-automation bot moved this to Backlog in Grimoire CSS Dec 26, 2025
@dmtrshat dmtrshat linked an issue Dec 26, 2025 that may be closed by this pull request
@dmtrshat dmtrshat merged commit be8b263 into rc/1.7.0 Dec 26, 2025
1 check passed
@github-project-automation github-project-automation bot moved this from Backlog to On RC in Grimoire CSS Dec 26, 2025
@dmtrshat dmtrshat changed the title feat: implement rustc-like errors with file/span context rustc-like errors with file/span context Dec 27, 2025
@dmtrshat dmtrshat moved this from On RC to Done in Grimoire CSS Dec 27, 2025
@dmtrshat dmtrshat deleted the feature/#95-improve-errors-info branch December 27, 2025 03:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Improve errors info

2 participants